<template>
  <div class="header">
    <mt-header :title="headTitle" fixed>
      <div slot="left" v-if="showBack" @click="goback">
        <!-- <mt-button icon="back"></mt-button> -->
        <i class="iconfont icon-fanhui"></i>
      </div>
      <!--       <nuxt-link :to="{name:'yuyue-yuyueRecord'}" slot="right" v-if="showAdd">
        <mt-button icon="more"></mt-button>
      </nuxt-link> -->
    </mt-header>
    <!--     <section class="h_goback">
      <i class="iconfont icon-fanhui" @click="goback"></i>
    </section>
    <section class="h_title">
      <span class="span_text">{{headTitle}}</span>
    </section> -->
  </div>
</template>
<script>
export default {
  props: ['headTitle', 'showBack'],
  methods: {
    goback() {
      // if (this.$route.path == '/curePatient') {
      //   this.$router.push('index.1');
      // } else {
      this.$router.back(-1);
      // }
    },
  },
};
</script>

<style>
  .header{
    background-color: #26a2ff;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 2.5rem;
  }
  .header .span_text{
    font-size: 0.8rem;
    color: #fff;
    text-align: center;
    font-weight: bold;
  }
  .h_goback{
    left: 0.4rem;
    width: 0.6rem;
    height: 1rem;
    line-height: 3rem;
    margin-left: .4rem;
  }
  .h_goback .iconfont{
    font-size: 1.3rem;
    font-weight: bold;
    color: #fff;
  }
  .h_title{
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    width: 50%;
    color: #fff;
    text-align: center;
  }
  .h_title .span_text{
    font-size: 1.2rem;
    color: #fff;
    text-align: center;
    font-weight: bold;
    font-family: "Microsoft Yahei";
  }

</style>
